//
//  ToastView.m
//  TenThousand
//
//  Created by 我的 on 16/6/27.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "ToastView.h"
#import <SVProgressHUD.h>

@implementation ToastView

+ (void)show
{
    [SVProgressHUD show];
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
    [SVProgressHUD setBackgroundColor:[UIColor colorWithRed:0.96 green:0.96 blue:0.96 alpha:1.00]];
}

+ (void)hide
{
    [SVProgressHUD dismiss];
}
 
+ (void)hideAfterDelay:(NSTimeInterval)time
{
    [SVProgressHUD dismissWithDelay:time];
}


+ (void)showErrorWithStatus:(NSString *)title
{
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
    [SVProgressHUD setBackgroundColor:[UIColor colorWithRed:0.96 green:0.96 blue:0.96 alpha:1.00]];
    [SVProgressHUD setForegroundColor:[UIColor colorWithRed:0.43 green:0.43 blue:0.43 alpha:1.00]];
    [SVProgressHUD setMinimumDismissTimeInterval:1.f];
    [SVProgressHUD showErrorWithStatus:title];
}

+ (void)showSuccessWithStatus:(NSString *)title
{
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
    [SVProgressHUD setBackgroundColor:[UIColor colorWithRed:0.96 green:0.96 blue:0.96 alpha:1.00]];
    [SVProgressHUD setForegroundColor:[UIColor colorWithRed:0.43 green:0.43 blue:0.43 alpha:1.00]];
    [SVProgressHUD setMinimumDismissTimeInterval:1.f];
    [SVProgressHUD showSuccessWithStatus:title];
}

+ (void)showInfoWithStatus:(NSString *)title
{
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
    [SVProgressHUD setBackgroundColor:[UIColor whiteColor]];
    [SVProgressHUD setForegroundColor:[UIColor colorWithRed:0.43 green:0.43 blue:0.43 alpha:1.00]];
    [SVProgressHUD setMinimumDismissTimeInterval:1.f];
    [SVProgressHUD showInfoWithStatus:title];
}

@end
